<p>This is an issue when numeric literals are long and difficult to read, or when numeric separators are used inconsistently.</p>
<h2>Why is this an issue?</h2>
<p>Long numeric literals without proper grouping are hard to read and prone to errors. When you see a number like <code>1000000</code>, it’s difficult
to quickly determine if it represents one million or ten million.</p>
<p>JavaScript supports numeric separators (underscores) to group digits and improve readability. For example, <code>1_000_000</code> is much clearer
than <code>1000000</code>. However, inconsistent use of separators can be just as confusing as not using them at all.</p>
<p>Different number types have conventional grouping patterns:</p>
<ul>
  <li> Decimal numbers are typically grouped in threes (like <code>1_234_567</code>) </li>
  <li> Hexadecimal numbers work well in groups of two or four (like <code>0xFF_EE_DD</code>) </li>
  <li> Binary numbers are often grouped in fours (like <code>0b1010_1111</code>) </li>
  <li> Octal numbers can be grouped in threes or fours </li>
</ul>
<p>Inconsistent grouping, such as <code>1_23_4567</code> or <code>0xA_B_CD_EF</code>, defeats the purpose of using separators and can actually make
numbers harder to read than if no separators were used at all.</p>
<h3>What is the potential impact?</h3>
<p>Poor numeric formatting reduces code readability and increases the likelihood of errors when working with large numbers. Developers may misread
values, leading to bugs in calculations, incorrect configuration values, or logic errors. This is particularly problematic in financial applications,
system configuration, or any domain involving precise numeric values.</p>
<h3>How to fix?</h3>
<p>Use consistent digit grouping with numeric separators. Group decimal numbers in threes from right to left, with any remainder at the beginning.</p>
<h4>Non-compliant code example</h4>
<pre data-diff-id="1" data-diff-type="noncompliant">
const price = 1234567; // Noncompliant
const count = 1_23_4567; // Noncompliant - inconsistent grouping
</pre>
<h4>Compliant code example</h4>
<pre data-diff-id="1" data-diff-type="compliant">
const price = 1_234_567;
const count = 1_234_567;
</pre>
<h3>Documentation</h3>
<ul>
  <li> <a href="https://github.com/sindresorhus/eslint-plugin-unicorn#readme">eslint-plugin-unicorn</a> - Rule <a
  href="https://github.com/sindresorhus/eslint-plugin-unicorn/blob/HEAD/docs/rules/numeric-separators-style.md">numeric-separators-style</a> </li>
  <li> MDN - Numeric Separators - <a
  href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Numeric_separators">Official documentation on JavaScript
  numeric separators</a> </li>
  <li> MDN - Number Literals - <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Numeric_literals">Complete
  guide to JavaScript numeric literal syntax</a> </li>
</ul>
